# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-websockets
_pkgname=websockets
pkgver=10.3
pkgrel=0
pkgdesc="An implementation of the WebSocket Protocol (RFC 6455)"
options="net"
url="https://websockets.readthedocs.io/"
arch="all"
license="BSD-3-Clause"
makedepends="python3-dev py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/aaugustin/websockets/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	python3 setup.py build
}

check() {
	# Tests fails because of legacy code
	rm -f tests/legacy/test_client_server.py tests/legacy/test_auth.py

	export WEBSOCKETS_TESTS_TIMEOUT_FACTOR=30
	python3 setup.py test
}

package() {
	python3 setup.py install --root="$pkgdir" --optimize=1
}

sha512sums="
75a11dd7605808954c5f59decda5b115db73de96ed4023d8d7ee3c9966551a9ded2d771f76b086c76f49b0787f19349dadcd9010eb5fea8eeddf3d9bba1c6cbb  py3-websockets-10.3.tar.gz
"
